//
//  CusmoterListCell.m
//  New_Runway
//
//  Created by mack on 2018/2/8.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "CusmoterListCell.h"
@interface CusmoterListCell ()
@property (weak, nonatomic) IBOutlet UIImageView *header;
@property (weak, nonatomic) IBOutlet UILabel *nickName;
@property (weak, nonatomic) IBOutlet UILabel *time;
@property (weak, nonatomic) IBOutlet UIButton *phone;

@end

@implementation CusmoterListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.header.layer.masksToBounds = YES;
    self.header.layer.cornerRadius = 35/2;
    self.header.layer.borderWidth = 0.5;
    self.header.layer.borderColor = UIColorHex(0xbfbfbf).CGColor;

}
-(void)setCustomerModel:(CustomerResult *)customerModel{
    
    _customerModel = customerModel;
    [self.header sd_setImageWithURL:[NSURL URLWithString:customerModel.customerHeadImage] placeholderImage:[UIImage imageNamed:@""]];
    self.nickName.text = customerModel.customerNickName;
    self.time.text = customerModel.createTime;
    if (customerModel.customerMobile) {
        self.phone.hidden = NO;
    }else{
        self.phone.hidden = YES;
    }
    
}

-(void)setIndex:(NSIndexPath *)index{
    _index = index;
}

- (IBAction)callCustomer:(id)sender {
    [self routerEventWithName:@"call" userInfo:@{@"index" : self.index}];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
